.class public Lcom/brixd/niceapp/model/PortalModel;
.super Ljava/lang/Object;
.source "PortalModel.java"

# interfaces
.implements Ljava/io/Serializable;


# instance fields
.field public bannerModels:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/BannerModel;",
            ">;"
        }
    .end annotation
.end field

.field public portalSectionModels:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/PortalSectionModel;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .registers 2

    .prologue
    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 15
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/brixd/niceapp/model/PortalModel;->portalSectionModels:Ljava/util/List;

    return-void
.end method

.method public static parsePortalModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/PortalModel;
    .registers 8
    .param p0, "jsonObject"    # Lorg/json/JSONObject;

    .prologue
    .line 20
    if-nez p0, :cond_4

    .line 21
    const/4 v4, 0x0

    .line 43
    :goto_3
    return-object v4

    .line 23
    :cond_4
    new-instance v4, Lcom/brixd/niceapp/model/PortalModel;

    invoke-direct {v4}, Lcom/brixd/niceapp/model/PortalModel;-><init>()V

    .line 25
    .local v4, "portalModel":Lcom/brixd/niceapp/model/PortalModel;
    const-string v6, "ads"

    invoke-virtual {p0, v6}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    invoke-static {v6}, Lcom/brixd/niceapp/model/BannerModel;->parseBannerModels(Lorg/json/JSONArray;)Ljava/util/List;

    move-result-object v6

    iput-object v6, v4, Lcom/brixd/niceapp/model/PortalModel;->bannerModels:Ljava/util/List;

    .line 27
    const-string v6, "daily_apps"

    invoke-virtual {p0, v6}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    invoke-static {v6}, Lcom/brixd/niceapp/model/AppModel;->parsePortalApps(Lorg/json/JSONArray;)Ljava/util/List;

    move-result-object v1

    .line 28
    .local v1, "dailyApps":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/AppModel;>;"
    new-instance v5, Lcom/brixd/niceapp/model/PortalSectionModel;

    sget-object v6, Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;->DailyApps:Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;

    invoke-direct {v5, v6, v1}, Lcom/brixd/niceapp/model/PortalSectionModel;-><init>(Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;Ljava/util/List;)V

    .line 29
    .local v5, "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    iget-object v6, v4, Lcom/brixd/niceapp/model/PortalModel;->portalSectionModels:Ljava/util/List;

    invoke-interface {v6, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 31
    const-string v6, "rank_users"

    invoke-virtual {p0, v6}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    invoke-static {v6}, Lcom/brixd/niceapp/model/UserModel;->parsePortalUserModel(Lorg/json/JSONArray;)Ljava/util/List;

    move-result-object v3

    .line 32
    .local v3, "popularUsers":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/UserModel;>;"
    new-instance v5, Lcom/brixd/niceapp/model/PortalSectionModel;

    .end local v5    # "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    sget-object v6, Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;->PopUsers:Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;

    invoke-direct {v5, v6, v3}, Lcom/brixd/niceapp/model/PortalSectionModel;-><init>(Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;Ljava/util/List;)V

    .line 33
    .restart local v5    # "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    iget-object v6, v4, Lcom/brixd/niceapp/model/PortalModel;->portalSectionModels:Ljava/util/List;

    invoke-interface {v6, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 35
    const-string v6, "albums"

    invoke-virtual {p0, v6}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    invoke-static {v6}, Lcom/brixd/niceapp/model/AlbumHolderModel;->parseAlbumHolderModels(Lorg/json/JSONArray;)Ljava/util/List;

    move-result-object v0

    .line 36
    .local v0, "albumHolderModels":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/AlbumHolderModel;>;"
    new-instance v5, Lcom/brixd/niceapp/model/PortalSectionModel;

    .end local v5    # "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    sget-object v6, Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;->Albums:Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;

    invoke-direct {v5, v6, v0}, Lcom/brixd/niceapp/model/PortalSectionModel;-><init>(Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;Ljava/util/List;)V

    .line 37
    .restart local v5    # "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    iget-object v6, v4, Lcom/brixd/niceapp/model/PortalModel;->portalSectionModels:Ljava/util/List;

    invoke-interface {v6, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 39
    const-string v6, "hot_apps"

    invoke-virtual {p0, v6}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v6

    invoke-static {v6}, Lcom/brixd/niceapp/model/AppModel;->parsePortalApps(Lorg/json/JSONArray;)Ljava/util/List;

    move-result-object v2

    .line 40
    .local v2, "hotApps":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/AppModel;>;"
    new-instance v5, Lcom/brixd/niceapp/model/PortalSectionModel;

    .end local v5    # "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    sget-object v6, Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;->HotApps:Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;

    invoke-direct {v5, v6, v2}, Lcom/brixd/niceapp/model/PortalSectionModel;-><init>(Lcom/brixd/niceapp/model/PortalSectionModel$SectionType;Ljava/util/List;)V

    .line 41
    .restart local v5    # "portalSectionModel":Lcom/brixd/niceapp/model/PortalSectionModel;
    iget-object v6, v4, Lcom/brixd/niceapp/model/PortalModel;->portalSectionModels:Ljava/util/List;

    invoke-interface {v6, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_3
.end method
